package cn.me.alphamq.common.entity.req;

import cn.me.alphamq.common.entity.BaseMsg;
import cn.me.alphamq.common.enumeration.ServiceInstanceTypeEnum;

import java.util.Map;

/**
 * 注册到 nameserver 的请求对象
 *
 * @author f
 */
public class ServiceRegistryReq extends BaseMsg {

    /**
     * 注册的服务实例的类型
     *
     * @see ServiceInstanceTypeEnum
     */
    private String serviceInstanceType;

    /**
     * 用户名
     */
    private String username;

    /**
     * 密码
     */
    private String password;

    /**
     * 本服务实例 的 ip 地址
     */
    private String ip;

    /**
     * 本服务实例 的 端口号
     */
    private Integer port;

    /**
     * 服务实例附带的参数
     */
    private Map<String, Object> attrs;

    public ServiceRegistryReq() {
    }

    public ServiceRegistryReq(String username, String password, String serviceInstanceType) {
        this.username = username;
        this.password = password;
        this.serviceInstanceType = serviceInstanceType;
    }

    public String getServiceInstanceType() {
        return serviceInstanceType;
    }

    public void setServiceInstanceType(String serviceInstanceType) {
        this.serviceInstanceType = serviceInstanceType;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public Map<String, Object> getAttrs() {
        return attrs;
    }

    public void setAttrs(Map<String, Object> attrs) {
        this.attrs = attrs;
    }
}
